class GeneratorTestsController < ApplicationController
  before_action :set_generator_test, only: [:show, :edit, :update, :destroy]

  # GET /generator_tests
  def index
    @generator_tests = GeneratorTest.all
  end

  # GET /generator_tests/1
  def show
  end

  # GET /generator_tests/new
  def new
    @generator_test = GeneratorTest.new
  end

  # GET /generator_tests/1/edit
  def edit
  end

  # POST /generator_tests
  def create
    @generator_test = GeneratorTest.new(generator_test_params)

    if @generator_test.save
      redirect_to @generator_test, notice: 'Generator test was successfully created.'
    else
      render :new
    end
  end

  # PATCH/PUT /generator_tests/1
  def update
    if @generator_test.update(generator_test_params)
      redirect_to @generator_test, notice: 'Generator test was successfully updated.'
    else
      render :edit
    end
  end

  # DELETE /generator_tests/1
  def destroy
    @generator_test.destroy
    redirect_to generator_tests_url, notice: 'Generator test was successfully destroyed.'
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_generator_test
      @generator_test = GeneratorTest.find(params[:id])
    end

    # Only allow a trusted parameter "white list" through.
    def generator_test_params
      params.require(:generator_test).permit(:name)
    end
end
